package com.webamc.dao.db4o;

import com.webamc.dao.IAMCTaskDao;
import com.webamc.model.AMCTask;
import com.webamc.util.DB4OUtil;
import org.apache.log4j.Logger;

import java.util.List;

/**
 * Created by Prash.
 * User: Choti
 * Date: Mar 11, 2009
 * Time: 11:41:42 PM
 * To change this template use File | Settings | File Templates.
 */
public class AMCTaskDao implements IAMCTaskDao {
    private Logger log = Logger.getLogger(AMCTaskDao.class);

    public boolean create(AMCTask c) {
        return DB4OUtil.insert(c);
    }

    public boolean update(AMCTask c) {
        return DB4OUtil.insert(c);
    }

    public AMCTask view(int id) {
        AMCTask p = new AMCTask();
        p.setAmcTaskId(id);
        List<AMCTask> l = search(p);
        return l.size() > 0 ? l.get(0) : null;
    }

    public List<AMCTask> search(AMCTask dummy) {
        return DB4OUtil.select(dummy);
    }

}
